<!DOCTYPE html>
<html lang="en">

<head>

    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <meta name="description" content="">
    <meta name="author" content="">

    <title>404</title>

    <!-- Bootstrap Core CSS -->
    <link href="/static/vendor/bootstrap/css/bootstrap.min.css" rel="stylesheet">

    <!-- MetisMenu CSS -->
    <link href="/static/vendor/metisMenu/metisMenu.min.css" rel="stylesheet">

    <!-- Custom CSS -->
    <link href="/static/dist/css/sb-admin-2.css" rel="stylesheet">

    <!-- Custom Fonts -->
    <link href="/static/vendor/font-awesome/css/font-awesome.min.css" rel="stylesheet" type="text/css">

    <!-- HTML5 Shim and Respond.js IE8 support of HTML5 elements and media queries -->
    <!-- WARNING: Respond.js doesn't work if you view the page via file:// -->
    <!--[if lt IE 9]>
        <script src="https://oss.maxcdn.com/libs/html5shiv/3.7.0/html5shiv.js"></script>
        <script src="https://oss.maxcdn.com/libs/respond.js/1.4.2/respond.min.js"></script>
    <![endif]-->

</head>

<body>

    <div class="container">
        <div class="row">
            <div class="col-md-4 col-md-offset-4" style="font-size: 34px">
                    <span id="error">
                        {{ error }}
                    </span>
                    <span style="color: red" id="times">
                    </span>
                    <span style="color: red">
                        &nbsp;秒后跳转到登录页
                    </span>
            </div>
        </div>
    </div>

    <!-- jQuery -->
    <script src="/static/vendor/jquery/jquery.min.js"></script>

    <!-- Bootstrap Core JavaScript -->
    <script src="/static/vendor/bootstrap/js/bootstrap.min.js"></script>

    <!-- Metis Menu Plugin JavaScript -->
    <script src="/static/vendor/metisMenu/metisMenu.min.js"></script>

    <!-- Custom Theme JavaScript -->
    <script src="/static/dist/js/sb-admin-2.js"></script>
    <script>
        var intDiff = parseInt(5);//倒计时总秒数量
        function timer(intDiff){
            window.setInterval(function(){
            intDiff--;
            if(intDiff > 0){
                $("#times").text(intDiff);
            }else{
                window.clearInterval(intDiff)
                window.location.href = "/login"
                }
            }, 1000);
        }
        $(
            function () {
                var content = $("#error").text();
                if(content.trim() == "当前用户未登录请登录"){
                    $("#times").text(intDiff);
                    timer(intDiff);
                }else{
                    alert("hi world")
                }
            }
        )
    </script>
</body>

</html>
